package org.jmetrix.samples.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.jmetrix.et.ExecutionTimeAspect;

/**
 * @author Konstantin Kuzmin
 * @version $Revision$
 * @since 21.10.11
 */
@Aspect
public class ExecutionTime extends ExecutionTimeAspect {
    @Override
    protected String getGroup(ProceedingJoinPoint pjp) {
        return pjp.getArgs()[0].getClass().getSimpleName();
    }

    @Around("call (public void org.jmetrix.samples.application.OrderManager.processOrder(..))")
    public Object processOrder(final ProceedingJoinPoint pjp) throws Throwable {
        return super.measure(pjp);
    }
}
